Global Const FF_DONTCARE = 0 ' Don't care or don't know.
Global Const FF_ROMAN = 16 ' Variable stroke width, serifed.
' Times Roman, Century Schoolbook, etc.
Global Const FF_SWISS = 32 ' Variable stroke width, sans-serifed.
' Helvetica, Swiss, etc.
Global Const FF_MODERN = 48 ' Constant stroke width, serifed or sans-serifed.
' Pica, Elite, Courier, etc.
Global Const FF_SCRIPT = 64 ' Cursive, etc.
Global Const FF_DECORATIVE = 80 ' Old English, etc.
' Font Weights
Global Const FW_DONTCARE = 0
Global Const FW_THIN = 100
Global Const FW_EXTRALIGHT = 200
Global Const FW_LIGHT = 300
Global Const FW_NORMAL = 400
Global Const FW_MEDIUM = 500
Global Const FW_SEMIBOLD = 600
Global Const FW_BOLD = 700
Global Const FW_EXTRABOLD = 800
Global Const FW_HEAVY = 900
Global Const FW_ULTRALIGHT = FW_EXTRALIGHT
Global Const FW_REGULAR = FW_NORMAL
Global Const FW_DEMIBOLD = FW_SEMIBOLD
Global Const FW_ULTRABOLD = FW_EXTRABOLD
Global Const FW_BLACK = FW_HEAVY
Global Const MM_TEXT = 1
Global Const MM_LOMETRIC = 2
Global Const MM_HIMETRIC = 3
Global Const MM_LOENGLISH = 4
Global Const MM_HIENGLISH = 5
Global Const MM_TWIPS = 6
Global Const MM_ISOTROPIC = 7
Global Const MM_ANISOTROPIC = 8
' Device Parameters for GetDeviceCaps()
Global Const DRIVERVERSION = 0 ' Device driver version
Global Const TECHNOLOGY = 2 ' Device classification
Global Const HORZSIZE = 4 ' Horizontal size in millimeters
Global Const VERTSIZE = 6 ' Vertical size in millimeters
Global Const HORZRES = 8 ' Horizontal width in pixels
Global Const VERTRES = 10 ' Vertical width in pixels
Global Const BITSPIXEL = 12 ' Number of bits per pixel
Global Const PLANES = 14 ' Number of planes
Global Const NUMBRUSHES = 16 ' Number of brushes the device has
Global Const NUMPENS = 18 ' Number of pens the device has
Global Const NUMMARKERS = 20 ' Number of markers the device has
Global Const NUMFONTS = 22 ' Number of fonts the device has
Global Const NUMCOLORS = 24 ' Number of colors the device supports
Global Const PDEVICESIZE = 26 ' Size required for device descriptor
Global Const CURVECAPS = 28 ' Curve capabilities
Global Const LINECAPS = 30 ' Line capabilities
Global Const POLYGONALCAPS = 32 'Polygonal capabilities
Global Const TEXTCAPS = 34 ' Text capabilities
Global Const CLIPCAPS = 36 ' Clipping capabilities
Global Const RASTERCAPS = 38 ' Bitblt capabilities
Global Const ASPECTX = 40 ' Length of the X leg
Global Const ASPECTY = 42 ' Length of the Y leg
Global Const ASPECTXY = 44 ' Length of the hypotenuse
Global Const LOGPIXELSX = 88 ' Logical pixels/inch in X
Global Const LOGPIXELSY = 90 ' Logical pixels/inch in Y
Global Const SIZEPALETTE = 104 ' Number of entries in physical palette
Global Const NUMRESERVED = 106 ' Number of reserved entries in palette
Global Const COLORRES = 108 ' Actual color resolution
' Device Capability Masks:
' Device Technologies
Global Const DT_PLOTTER = 0 ' Vector plotter
Global Const DT_RASDISPLAY = 1 'Raster display
Global Const DT_RASPRINTER = 2 ' Raster printer
Global Const DT_RASCAMERA = 3 'Raster camera
Global Const DT_CHARSTREAM = 4 'Character-stream, PLP
Global Const DT_METAFILE = 5 'Metafile, VDM
Global Const DT_DISPFILE = 6 ' Display-file
' Curve Capabilities
Global Const CC_NONE = 0 ' Curves not supported
Global Const CC_CIRCLES = 1 ' Can do circles
Global Const CC_PIE = 2 ' Can do pie wedges
Global Const CC_CHORD = 4 ' Can do chord arcs
Global Const CC_ELLIPSES = 8 ' Can do ellipese
Global Const CC_WIDE = 16 ' Can do wide lines
Global Const CC_STYLED = 32 ' Can do styled lines
Global Const CC_WIDESTYLED = 64 ' Can do wide styled lines
Global Const CC_INTERIORS = 128 ' Can do interiors
' Line Capabilities
Global Const LC_NONE = 0 ' Lines not supported
Global Const LC_POLYLINE = 2 ' Can do polylines
Global Const LC_MARKER = 4 ' Can do markers
Global Const LC_POLYMARKER = 8 ' Can do polymarkers
Global Const LC_WIDE = 16 ' Can do wide lines
Global Const LC_STYLED = 32 ' Can do styled lines
Global Const LC_WIDESTYLED = 64 ' Can do wide styled lines
Global Const LC_INTERIORS = 128 ' Can do interiors
' Polygonal Capabilities
Global Const PC_NONE = 0 ' Polygonals not supported
Global Const PC_POLYGON = 1 ' Can do polygons
Global Const PC_RECTANGLE = 2 ' Can do rectangles
Global Const PC_WINDPOLYGON = 4 ' Can do winding polygons
Global Const PC_TRAPEZOID = 4 ' Can do trapezoids
Global Const PC_SCANLINE = 8 ' Can do scanlines
Global Const PC_WIDE = 16 ' Can do wide borders
Global Const PC_STYLED = 32 ' Can do styled borders
Global Const PC_WIDESTYLED = 64 ' Can do widestyled borders
Global Const PC_INTERIORS = 128 ' Can do interiors
' Polygonal Capabilities
Global Const CP_NONE = 0 ' No clippingof output
Global Const CP_RECTANGLE = 1 ' Output clipped to rects
' Text Capabilities
Global Const TC_OP_CHARACTER = &H1 ' Can do OutputPrecision CHARACTER
Global Const TC_OP_STROKE = &H2 ' Can do OutputPrecision STROKE
Global Const TC_CP_STROKE = &H4 ' Can do ClipPrecision STROKE
Global Const TC_CR_90 = &H8 ' Can do CharRotAbility 90
Global Const TC_CR_ANY = &H10 ' Can do CharRotAbility ANY
Global Const TC_SF_X_YINDEP = &H20 ' Can do ScaleFreedom X_YINDEPENDENT
Global Const TC_SA_DOUBLE = &H40 ' Can do ScaleAbility DOUBLE
Global Const TC_SA_INTEGER = &H80 ' Can do ScaleAbility INTEGER
Global Const TC_SA_CONTIN = &H100 ' Can do ScaleAbility CONTINUOUS
Global Const TC_EA_DOUBLE = &H200 ' Can do EmboldenAbility DOUBLE
Global Const TC_IA_ABLE = &H400 ' Can do ItalisizeAbility ABLE
Global Const TC_UA_ABLE = &H800 ' Can do UnderlineAbility ABLE
Global Const TC_SO_ABLE = &H1000 ' Can do StrikeOutAbility ABLE
Global Const TC_RA_ABLE = &H2000 ' Can do RasterFontAble ABLE
Global Const TC_VA_ABLE = &H4000 ' Can do VectorFontAble ABLE
Global Const TC_RESERVED = &H8000
' Brush Styles
Global Const BS_SOLID = 0
Global Const BS_NULL = 1
Global Const BS_HOLLOW = BS_NULL
Global Const BS_HATCHED = 2
Global Const BS_PATTERN = 3
Global Const BS_INDEXED = 4
Global Const BS_DIBPATTERN = 5
' Hatch Styles
Global Const HS_HORIZONTAL = 0 ' -----
Global Const HS_VERTICAL = 1 ' |||||
Global Const HS_FDIAGONAL = 2 ' \\\\\
Global Const HS_BDIAGONAL = 3 ' /////
Global Const HS_CROSS = 4 ' +++++
Global Const HS_DIAGCROSS = 5 ' xxxxx
' Pen Styles
Global Const PS_SOLID = 0
Global Const PS_DASH = 1 ' -------
Global Const PS_DOT = 2 ' .......
Global Const PS_DASHDOT = 3 ' _._._._
Global Const PS_DASHDOTDOT = 4 ' _.._.._
Global Const PS_NULL = 5
Global Const PS_INSIDEFRAME = 6
Type Rect
left As Integer
Top As Integer
right As Integer
bottom As Integer
End Type
Type POINTAPI
X As Integer
Y As Integer
End Type
Type PAINTSTRUCT
hDC As Integer
ferase As Integer
rcpaint As Rect
fRestore As Integer
fIncUpdate As Integer
rgbReserved As String * 16
End Type
Type RGBTRIPLE
rgbtBlue As String * 1
rgbtGreen As String * 1
rgbtRed As String * 1
End Type
' Logical Brush (or Pattern)
Type LOGBRUSH
lbStyle As Integer
lbColor As Long
lbHatch As Integer
End Type
' Logical Pen
Type LOGPEN
lopnStyle As Integer
lopnWidth As POINTAPI
lopnColor As Long
End Type
Type LOGFONT
lfHeight As Integer
lfWidth As Integer
lfEscapement As Integer
lfOrientation As Integer
lfWeight As Integer
lfItalic As String * 1
lfUnderline As String * 1
lfStrikeOut As String * 1
lfCharSet As String * 1
lfOutPrecision As String * 1
lfClipPrecision As String * 1
lfQuality As String * 1
lfPitchAndFamily As String * 1
lfFaceName As String * LF_FACESIZE
End Type
Global FontType As LOGFONT
Global BrushType As LOGBRUSH
Global gDrawRectangle As Rect
Global gMdc% 'metafile device context
Global gHmf% 'Metafile Handle
Declare Function DrawText Lib "GDI" (ByVal hDC As Integer, ByVal lpStr As String, ByVal nCount As Integer, lpRect As Rect, ByVal wFormat As Integer) As Integer
Declare Function TextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Integer
Declare Function CreateFontIndirect Lib "GDI" (lpLogFont As LOGFONT) As Integer
Declare Function FloodFill Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Integer
Declare Function SetTextJustification Lib "GDI" (ByVal hDC As Integer, ByVal nBreakExtra As Integer, ByVal nBreakCount As Integer) As Integer
Declare Function GetTextExtent Lib "GDI" (ByVal hDC As Integer, ByVal lpString As String, ByVal nCount As Integer) As Long
Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
Declare Function CreatePenIndirect Lib "GDI" (lpLogPen As LOGPEN) As Integer
Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
Declare Function CreateHatchBrush Lib "GDI" (ByVal nIndex As Integer, ByVal crColor As Long) As Integer
Declare Function CreateBrushIndirect Lib "GDI" (lpLogBrush As LOGBRUSH) As Integer
Declare Function SelectObject Lib "GDI" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
Declare Function SetBkColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
Declare Function GetBkColor Lib "GDI" (ByVal hDC As Integer) As Long
Declare Function SetBkMode Lib "GDI" (ByVal hDC As Integer, ByVal nBkMode As Integer) As Integer
Declare Function GetBkMode Lib "GDI" (ByVal hDC As Integer) As Integer
Declare Function SetTextColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
Declare Function GetTextColor Lib "GDI" (ByVal hDC As Integer) As Long
Declare Function SetTextAlign Lib "GDI" (ByVal hDC As Integer, ByVal wFlags As Integer) As Integer
Declare Function GetTextAlign Lib "GDI" (ByVal hDC As Integer) As Integer
Declare Function GetFocus Lib "User" () As Integer
Declare Sub GetClientRect Lib "User" (ByVal hWnd As Integer, lpRect As Rect)
Declare Function DeleteMetafile Lib "GDI" (ByVal gHmf As Integer) As Integer
Declare Function CreateMetaFile Lib "GDI" (ByVal lpString As Any) As Integer
Declare Function Arc Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
Declare Function CloseMetaFile% Lib "GDI" (ByVal hDC%)
Declare Function PlayMetaFile% Lib "GDI" (ByVal hDC%, ByVal gHmf%)
Declare Function Ellipse Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
Declare Function GetMetaFileBits Lib "GDI" (ByVal gHmf As Integer) As Integer
Declare Function CopyMetaFile Lib "GDI" (ByVal gHmf As Integer, ByVal lpFilename As String) As Integer
Declare Function SetMapMode Lib "GDI" (ByVal hDC As Integer, ByVal nMapMode As Integer) As Integer
Declare Function SetWindowExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
Declare Function SetViewPortExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
Declare Function SetWindowOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
Declare Function BeginPaint Lib "User" (ByVal hWnd As Integer, lpPaint As PAINTSTRUCT) As Integer
Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC As Integer, ByVal nIndex As Integer) As Integer
Declare Function GetMetaFile Lib "GDI" (ByVal lpFilename As String) As Integer